﻿using Pibby.Core;
using Pibby.Core.Feeds;

namespace Pibby.Controls
{
	public class PodcastListViewItem : System.Windows.Forms.ListViewItem
	{
		private int _id;

		public PodcastListViewItem(Podcast p)
			: base ()
		{
			this._id = p.DbKey;
			base.Text = p.Name;
			base.ImageIndex = 0;

			base.SubItems.Add(new ListViewDateSubItem(p.PublicationDate));
			base.SubItems.Add(new ListViewIntegerSubItem(p.Whuffie.Score));
            base.SubItems.Add(XmlSanitizer.StripHtml(p.Description));
			base.SubItems.Add(p.Feed.AbsoluteUri);
        }

		public int Id
		{
			get { return this._id; }
		}
	}
}

